<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="" method="post">
    {% csrf_token %}
    <p>
        &emsp;物资编号：<input type="text" value="{{ material_obj.mater_num }}" name="mater_num">
    </p>
    <p>
        &emsp;物资名称：<input type="text" value="{{ material_obj.material_name }}" name="material_name">
    </p>
    <p>
        &emsp;购买时间：<input type="text" value="{{ material_obj.buy_time }}" name="buy_time">
    </p>
    <p>所属实验室：<select name="l_id">
    {% for foo in lab_obj %}
        {% if foo in material_obj.l_id %}
            <option selected value="{{ foo.pk }}">{{ foo.l_name }}</option>
            {% else %}
            <option value="{{ foo.pk }}">{{ foo.l_name }}</option>
        {% endif %}
    {% endfor %}</select>
    </p>
<button>提交</button>
</form>
</body>
</html>